<template>
  <div class="wrap">
    <header>
      <span @click="go()">&lt;</span>
      <p>详情</p>
    </header>
    <main>
      <dl>
        <dt>
          <img :src="list.img" alt />
        </dt>
        <dd>
          <h3>
            {{list.introduce}}
            <button @click="toVR()">VR</button>
          </h3>
          <p>
            <span>{{list.price}}万</span>
            <span>{{list.styles}}</span>
            <span>{{list.num}}m²</span>
          </p>
        </dd>
      </dl>
      <div class="intro">
        <h3>房源信息</h3>
        <img src="../img/ban.png" alt />
      </div>
      <div class="intro1">
        <h3>房源信息</h3>
        <div>
          <h4>核心卖点</h4>
          <img src="../img/1.png" alt />
        </div>
        <div>
          <h4>业主心态</h4>
          <img src="../img/2.png" alt />
        </div>
        <div class="fu">
          <h4>服务介绍</h4>
          <img src="../img/3.png" alt />
        </div>
      </div>
    </main>
  </div>
</template>

<script>
import axios from "../utils/request";
export default {
  data() {
    return {
      list: []
    };
  },
  created() {
    this.getList();
  },
  methods: {
    go() {
      this.$router.go(-1);
    },
    getList() {
      axios({
        url: "/api/detail",
        method: "post",
        data: this.$route.params
      }).then(res => {
        // console.log(res);
        this.list = res.data.data;
      });
    },

    toVR(){
      this.$router.push('/vr')
    }
  }
};
</script>

<style lang="scss" scoped>
.wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
header {
  width: 100%;
  height: 50px;
  display: flex;
  line-height: 50px;
  align-items: center;
  background: rgb(56, 121, 240);
  padding: 15px;
  color: #fff;
  p {
    padding-left: 38%;
  }
}
main {
  flex: 1;
  overflow-y: scroll;
  dl {
    dt img {
      width: 100%;
      height: 200px;
    }
    dd {
      margin: 10px;
      h3 {
        font-size: 20px;
      }
      img {
        height: 30px;
      }
      p {
        padding: 15px 0;
        display: flex;
        align-items: center;
        span {
          margin-right: 10px;
          color: orangered;
        }
      }
    }
  }
  .intro {
    margin:15px 0;
    h3 {
      padding: 10px 0;
      color: rgb(59, 58, 58);
    }
    img {
      height: 150px;
      padding: 5px;
    }
  }
  .intro1 {
    margin: 15px;
    h3 {
      padding: 10px 0;
      color: rgb(59, 58, 58);
    }
    div {
      h4 {
        padding: 10px 0;
        color: rgb(94, 89, 89);
      }
      img {
        width: 100%;
        height: 50px;
        margin-top: 5px;
      }
    }
    .fu {
      h4 {
        padding: 10px 0;
        color: rgb(94, 89, 89);
      }
      img {
        width: 100%;
        height: 140px;
        margin-top: 5px;
      }
    }
  }
}
</style>